﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace QuanLyThuNgan
{
    public class DMLyDoHoanDAO
    {
        public bool m_Insert(DMLyDoHoanDTO _info)
        {
            int istop = 0;
            if (_info.BStop == true)
                istop = 1;
            string _sql = string.Format("usp_ThuNgan_DMLyDoHoan_Insert  N'{0}',{1}", _info.STenLyDo, istop);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Update(DMLyDoHoanDTO _info)
        {
            int istop = 0;
            if (_info.BStop == true)
                istop = 1;
            string _sql = string.Format("usp_ThuNgan_DMLyDoHoan_Update {0},N'{1}',{2}", _info.IIDLyDo, _info.STenLyDo, istop);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Delete(DMLyDoHoanDTO _info)
        {
            string _sql = string.Format("usp_ThuNgan_DMLyDoHoan_Delete {0}", _info.IIDLyDo);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }

        public DataTable m_SelectAllDMLyDoHoan()
        {
            string _sql = string.Format("usp_ThuNgan_DMLyDoHoan_SelectAll ");
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }

        //Relect to Frm_HoanTien---------
        public DataTable m_SelectDMLyDoHoan()
        {
            string _sql = string.Format("usp_ThuNgan_DMLyDoHoan_SelectLyDoHoan ");
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }
    }
}
